/******************************************************************
 *  MRRM's global definitions                                     *
 *                                                                *
 *  This file is part of the MRRM project                         *
 *  <http://mrrm.googlecode.com/>                                 *
 *                                                                *
 *  Author(s):                                                    *
 *    -  Yuan Pengfei <coolypf@opencores.org>                     *
 *                                                                *
 ******************************************************************
 *                                                                *
 *  Copyright (C) 2010 AUTHORS                                    *
 *                                                                *
 *  This source file may be used and distributed without          *
 *  restriction provided that this copyright statement is not     *
 *  removed from the file and that any derivative work contains   *
 *  the original copyright notice and the associated disclaimer.  *
 *                                                                *
 *  MRRM is free software: you can redistribute it and/or modify  *
 *  it under the terms of the GNU General Public License as       *
 *  published by the Free Software Foundation, either version 3   *
 *  of the License, or (at your option) any later version.        *
 *                                                                *
 *  MRRM is distributed in the hope that it will be useful, but   *
 *  WITHOUT ANY WARRANTY; without even the implied warranty of    *
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  *
 *  GNU General Public License for more details.                  *
 *                                                                *
 *  You should have received a copy of the GNU General Public     *
 *  License along with MRRM. If not, see                          *
 *  <http://www.gnu.org/licenses/>.                               *
 *                                                                *
 ******************************************************************/

// General Definitions

`define INSTRUCTION_WIDTH       32
`define OPERAND_WIDTH		     32
`define MEMORY_ADDR_WIDTH       32
`define REGFILE_ADDR_WIDTH	     5

`define SNL_BIT                 24

`define RST_VALUE               1'b1
`define RST_EVENT               posedge

`define REG_PC                  5'd31
`define REG_LR                  5'd30

// Opcodes

`define I_REG                   3'b000
`define I_IMM                   3'b001
`define I_LSR                   3'b010
`define I_LSI                   3'b011
`define I_BXX                   3'b101
`define I_HLT                   3'b110
`define I_NOP                   3'b111

`define S_ONE                   2'b00
`define S_TWO                   2'b11

`define F_AND                   4'b0000
`define F_XOR                   4'b0001
`define F_SUB                   4'b0010
`define F_RSB                   4'b0011
`define F_ADD                   4'b0100
`define F_ADC                   4'b0101
`define F_SBC                   4'b0110
`define F_RSC                   4'b0111
`define F_CAND                  4'b1000
`define F_CXOR                  4'b1001
`define F_CSUB                  4'b1010
`define F_CADD                  4'b1011
`define F_ORR                   4'b1100
`define F_MOV                   4'b1101
`define F_CLB                   4'b1110
`define F_MVN                   4'b1111

`define F_MUL                   4'b0000
`define F_MULSL                 4'b0100
`define F_JUMP                  4'b1000

`define ALU_ADD                 3'b000
`define ALU_SUB                 3'b001
`define ALU_AND                 3'b010
`define ALU_OR                  3'b011
`define ALU_MUL                 3'b100
`define ALU_MULSL               3'b101
`define ALU_MOV                 3'b110
`define ALU_UDF                 3'b111

`define COND_EQ                 4'b0000
`define COND_NE                 4'b0001
`define COND_UGE                4'b0010
`define COND_ULT                4'b0011
`define COND_N                  4'b0100
`define COND_NN                 4'b0101
`define COND_OV                 4'b0110
`define COND_NV                 4'b0111
`define COND_UGT                4'b1000
`define COND_ULE                4'b1001
`define COND_SGE                4'b1010
`define COND_SLT                4'b1011
`define COND_SGT                4'b1100
`define COND_SLE                4'b1101
`define COND_AL                 4'b1110
